//
//  ForgetPwdVC.m
//  WalletAPP
//
//  Created by 罗弟祥 on 2019/10/12.
//  Copyright © 2019 罗弟祥. All rights reserved.
//

#import "ForgetPwdVC.h"
#import "ReForgetPwdVC.h"


@interface ForgetPwdVC ()
@property (weak, nonatomic) IBOutlet UITextField *emailTF;
@property (weak, nonatomic) IBOutlet UIButton *getCodeBtnClick;

@property (nonatomic, retain) RefreshVM *vm;
@end

@implementation ForgetPwdVC


- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}
- (IBAction)backBtnClick:(UIButton *)sender {
    [self.navigationController popViewControllerAnimated:YES];
}
- (IBAction)getCodeBtnClick:(UIButton *)sender {
    
    if (self.emailTF.text.length<1) {
        [SVProgressHUD showErrorWithStatus:@"请输入邀请码"];
        return;
    }
    [self getVerbCodeRequest];
    
}


-(void)getVerbCodeRequest{
    self.vm = [RefreshVM new];
    self.vm.urlStr = @"/api/password/code";
    self.vm.params = @{@"account":self.emailTF.text};
//    self.vm.dataClass = [CodeModel class];
    [self.vm requestDataNormal];
    [self.vm setRequestResultBlock:^(id obj) {
        
        [Utils showHudWithTitle:@"验证码已发送" delay:2 completionBlock:^{
            ReForgetPwdVC *vc = [ReForgetPwdVC new];
            vc.email = self.emailTF.text;
            [self.navigationController pushViewController:vc animated:YES];
        }];
    }];
}



/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
